import React from 'react'
import { Menu } from '@/model/declare'
import { View, Image } from '@tarojs/components'

import './index.scss'
import { reqto } from '@/utils/nav'
// import { Icon } from '@/components/Icon'

export const MenuItem: React.FC<Menu> = (props) => {
    return (
        <View className="xxm-menu-ls" onClick={()=>{
            reqto({...props})
        }}>
            <View className="xxm-menu-ls__icon">
                {props.icon &&
                    <Image
                        src={props.icon}
                        className="xxm-menu-ls__icon__img"
                    />}
            </View>
            <View className="xxm-menu-ls__text">
                {props.name}
            </View>
        </View>
    )
}